#include <bits/stdc++.h>
using namespace std;
#define int long long

void solve() {
    string s;
    cin >> s;
    if(s.back() == 'i') {
        s[s.size() - 1] = 'u';
        s += 's';
    }else{
        s.pop_back();
        s[s.size() - 1] = 'i';
    }
    cout << s << endl;
}

signed main() {
    int t; cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}